package com.demo.camunda.service.impl;

import com.demo.camunda.dao.MsgTDao;
import com.demo.camunda.entity.MsgclientT;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class uploadTExcelImpl {

    @Autowired
    private MsgTDao msgTDao;


    @Async(value="myExecutor")
    public void insertList2(List<MsgclientT> list){
        log.info("{}条数据，第二个sheet开始存储数据库!", list.size());

        log.info(Thread.currentThread().getName());

        if(CollectionUtils.isNotEmpty(list)){
            msgTDao.insertList2(list);
        }
        log.info("第二个sheet存储数据库成功!");
    }
}
